1. Field of the Invention
The present invention relates to computing systems, and more particularly to maintaining data integrity in PCI-Express devices.
2. Background of the Invention
Conventional computing systems typically include several functional components. These components may include a central processing unit (CPU), main memory, input/output (“I/O”) devices, and streaming storage devices (for example, tape drives). In conventional systems, the main memory is coupled to the CPU via a system bus or a local memory bus. The main memory is used to provide the CPU access to data and/or program information that is stored in main memory at execution time. Typically, the main memory is composed of random access memory (RAM) circuits. A computer system with the CPU and main memory is often referred to as a host system.
Host systems are used in various network applications, including storage area networks (“SANs”). In SANs, plural memory storage devices are made available to various host computing systems. Data in a SAN is typically moved between plural host systems and storage systems (or storage devices, used interchangeably throughout this specification) through various controllers/adapters. Host systems often communicate with storage systems via a host bus adapter (“HBA”, may also be referred to as a “controller” and/or “adapter”).
Host systems often communicate with peripheral devices via an interface such as the Peripheral Component Interconnect (“PCI”) interface, a local bus standard that uses parallel data transfer, or the extension of PCI known as PCI-X. Both the PCI and PCI-X standard specifications are incorporated herein by reference in their entirety.
More recently, PCI-Express, a standard interface incorporating PCI transaction protocols at the logical level, but using serial data transfer at the physical level has been developed to offer better performance than PCI or PCI-X. PCI-Express is an Input/Output (“I/O”) bus standard (incorporated herein by reference in its entirety) that is compatible with existing PCI cards using the PCI Express bus.
HBAs (a PCI-Express device) that are placed in SANs, receive serial data streams (bit stream), align the serial data and then convert it into parallel data for processing. HBAs operate as a transmitting device as well as a receiving device.
When data is moved from host system memory to storage systems and vice-versa, it needs to be protected. This is because memory in electronic devices has the potential to return incorrect information. There are two types of errors, “hard” and “soft”. A hard error may occur when a bit may be stuck so that it always returns “0”. A soft error occurs when a bit reads back wrong information once and then functions properly. Soft errors are more difficult to detect versus hard errors.
Data can be protected using parity and error correction code (“ECC”). Parity checking is a rudimentary way of checking single bit errors. Parity adds a bit of data to every 8-bits (or other sizes) of data. When parity checking is enabled, a logic circuit called a parity generator/checker examines every byte of data and determines whether the data byte has an even or an odd number of ones. If it has odd number of ones, the ninth bit is set to one; otherwise it is set to zero. When data is read, the parity circuit operates as a checker and determines if there are odd or even number of ones to determine if there is a bit-error. Parity checking provides single-bit error detection, but does not handle multi-bit errors, and does not correct errors.
ECC is used to detect single/multiple bit errors and corrects errors. A special algorithm (for example, SECDED (Single Error Correction with Double Error Detection) algorithm) is used to encode information in a block of bits that contains enough detail to permit recovery of a single bit error in the protected data. ECC typically uses 8 bits of code to protect 64 bits of data.
HBAs operating in networks use ECC to protect data when data is moved from host system memory to HBA memory and then sent to a storage system (i.e. in the transmit path). ECC is also used to protect data when it is received from a storage system and sent to host system memory via the HBA (receive path).
Often data has to be aligned, padded and/or shortened (by removing padding) at the HBA level when data is being moved through a data path in the HBA. ECC has to be generated/re-generated depending on how data is being aligned and handled. This requires ECC data to be checked and re-generated for each re-alignment option at each transition in transmit/receive data paths. As the number of re-alignments increase, the number of gates required to re-generate and check ECC increases. This increases cost and complexity and is hence undesirable.
Therefore, there is a need for a method and system that can efficiently generate and verify ECC in an environment where data is aligned/re-aligned.